<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 它只返回第一个满足条件的索引号 
        // 它如果在该数组里面找不到元素，则返回的是 -1  
    let arr = [1,2,3,4,5,6,7]
    console.log(arr.indexOf(4))//3
    let arr1 = ['red', 'green', 'blue', 'pink', 'blue'];
    //倒着找
        console.log(arr.lastIndexOf('blue')); // 4
  </script>
</body>
</html>